using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace System
{
    public static class StringExtentionsRegEx
    {
        public static string FindRegEx(this string str, Regex regex, string Default = "")
        {
            return regex.Match(str).OrDefault(Default);
        }

        public static IEnumerable<Match> FindAllRegExMatch(this string str, Regex regex)
        {
            return regex.Matches(str).Cast<Match>();
        }

        public static IEnumerable<string> FindAllRegEx(this string str, Regex regex)
        {
            return str.FindAllRegExMatch(regex).Select(m => m.Value);
        }
    }
}

namespace System.Text.RegularExpressions
{
    public static class RegExExtentions
    {
        public static string OrDefault(this Match match, string Default = "")
        {
            return match.Success ? match.Value : Default;
        }
    }
}